<template>
  <div id="app">
    <Header />
<!--    <div class="change" title="旧门户" @click="change()">-->
<!--      <img-->
<!--        src="./assets/img/exchange.png"-->
<!--        alt=""-->
<!--        style="width: 30px; height: 30px"-->
<!--      />-->
<!--    </div>-->
    <router-view />
  </div>
</template>

<script>
import Header from "./components/Header.vue"; // 引入头部组件
import { getPortalold } from "@/api/index";

export default {
  name: "App",
  components: {
    Header, // 注册头部组件
  },
  methods: {
    change() {
      this.$confirm("此操作将切换到旧门户, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          getPortalold(window.sid).then((res) => {
       console.log(res,'res3')
            setTimeout(function() {
              window.parent.refreshIframe();
    }, 1000); // 延时2秒
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消切换",
          });
        });
    },
  },
};
</script>

<style>
/* 全局样式可以在这里添加 */
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
.change {
  position: fixed;
  right: 1%;
  top: 50%;
  background: #e9f0fa;
  padding: 8px;
  z-index: 99999;
  border-radius: 10px;
}
</style>
